import { BasicColumn } from "/@/components/Table"
import { FormSchema } from "/@/components/Table"
import { formatToDateTime } from "/@/utils/dateUtil"
import { DescItem } from "/@/components/Description/index"

export const detailSchema: DescItem[] = [
  {
    field: "id",
    label: "登录ID",
  },
  {
    field: "userName",
    label: "用户名",
  },
  {
    field: "clientId",
    label: "客户端ID",
  },
  {
    field: "loginIp",
    label: "登录IP",
  },
  {
    field: "loginLocation",
    label: "登录地址",
  },
  {
    field: "os",
    label: "操作系统",
  },
  {
    field: "browser",
    label: "浏览器",
  },
  {
    field: "timeout",
    label: "超时时间",
  },
  {
    field: "loginTime",
    label: "登录时间",
  },
  {
    field: "terminalName",
    label: "登录终端",
  },
]

export const columns: BasicColumn[] = [
  {
    title: "登录ID",
    dataIndex: "id", // 登录ID
    width: 130,
  },
  {
    title: "用户名",
    dataIndex: "userName",
    width: 100,
  },
  {
    title: "登录IP",
    dataIndex: "loginIp",
    width: 120,
  },
  {
    title: "登录地址",
    dataIndex: "loginLocation",
    width: 160,
  },
  {
    title: "超时时间",
    dataIndex: "timeout",
    width: 160,
    sorter: true,
  },
  {
    title: "登录时间",
    dataIndex: "loginTime",
    width: 160,
    sorter: true,
  },
  {
    title: "终端",
    dataIndex: "terminalName",
    width: 110
  },

]

export const searchFormSchema: FormSchema[] = [
  {
    label: "登录IP",
    field: "loginIp",
    component: "Input",
  },
  {
    label: "用户名称",
    field: "userName",
    component: "Input",
  },
]
